package com.luych.toolbox.common.feign.view.data.service;

import com.luych.toolbox.common.enums.DataBackupHistoryStatus;
import com.luych.toolbox.common.enums.DataBackupHistoryType;
import com.luych.toolbox.common.feign.FeignView;
import com.luych.toolbox.common.feign.view.base.service.UserView;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;

@ApiModel("数据备份历史")
public class DataBackupHistoryView extends FeignView {

    @ApiModelProperty("数据源")
    private DataSourceView dataSource;
    @ApiModelProperty("数据代理")
    private DataAgentView dataAgent;
    @ApiModelProperty("数据备份计划")
    private DataBackupPlanView dataBackupPlan;
    @ApiModelProperty("描述")
    private String name;
    @ApiModelProperty("类型")
    private DataBackupHistoryType type;
    @ApiModelProperty("备份文件")
    private String file;
    @ApiModelProperty("状态")
    private DataBackupHistoryStatus status;
    @ApiModelProperty("异常信息")
    private String errorMessage;
    @ApiModelProperty("异常堆栈")
    private String errorTrace;
    @ApiModelProperty("责任人")
    private UserView owner;
    @ApiModelProperty("开始时间")
    private Date startDate;
    @ApiModelProperty("结束时间")
    private Date completeDate;

    public DataSourceView getDataSource() {
        return dataSource;
    }

    public String getDataSourceId() {
        return dataSource == null ? null : dataSource.getId();
    }

    public void setDataSource(DataSourceView dataSource) {
        this.dataSource = dataSource;
    }

    public DataAgentView getDataAgent() {
        return dataAgent;
    }

    public String getDataAgentId() {
        return dataAgent == null ? null : dataAgent.getId();
    }

    public void setDataAgent(DataAgentView dataAgent) {
        this.dataAgent = dataAgent;
    }

    public DataBackupPlanView getDataBackupPlan() {
        return dataBackupPlan;
    }

    public String getDataBackupPlanId() {
        return dataBackupPlan == null ? null : dataBackupPlan.getId();
    }

    public void setDataBackupPlan(DataBackupPlanView dataBackupPlan) {
        this.dataBackupPlan = dataBackupPlan;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public DataBackupHistoryType getType() {
        return type;
    }

    public String getTypeValue() {
        return type == null ? null : type.getValue();
    }

    public void setType(DataBackupHistoryType type) {
        this.type = type;
    }

    public String getFile() {
        return file;
    }

    public void setFile(String file) {
        this.file = file;
    }

    public DataBackupHistoryStatus getStatus() {
        return status;
    }

    public void setStatus(DataBackupHistoryStatus status) {
        this.status = status;
    }

    public String getStatusValue() {
        return status == null ? null : status.getValue();
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public String getErrorTrace() {
        return errorTrace;
    }

    public void setErrorTrace(String errorTrace) {
        this.errorTrace = errorTrace;
    }

    public UserView getOwner() {
        return owner;
    }

    public void setOwner(UserView owner) {
        this.owner = owner;
    }

    public String getOwnerId() {
        return owner == null ? null : owner.getId();
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getCompleteDate() {
        return completeDate;
    }

    public void setCompleteDate(Date completeDate) {
        this.completeDate = completeDate;
    }
}
